console.log(Array(3, 4));
new Array(3)

Array.of(3, 4)

Array(100).fill().map((v, i) => i)

// [...Array(100).keys()]

// 题目 怎么实现
// arr[-1] == arr[arr.length - 1]

function creatArr(...args) {
    let arr = [...args]


    let handle = {
        get(target, key, receiver) {
            // console.log(target, key);
            let index = Number(key)
            if(index < 0) {
                index = index + target.length
                return Reflect.get(target, index)
            }
            return Reflect.get(target, key)
            
        },
        set() {

        }
    } 

    return new Proxy(arr, handle)
}

let arr = creatArr(1,2)

console.log(arr[-1] ==  arr[arr.length - 1]);